/**
 * File: CourseRecord.java
 * Author: Ben Stutsky/Wesley Lok
 * Team: Bob-omb Squad
 * Date: 4/26/11
 * Email: stutsky1@umbc.edu
 */
package clientApp;

import java.io.Serializable;

/**
 * The Class CourseRecord.
 */
public class CourseRecord implements Serializable
{
	private static final long serialVersionUID = 2342432747159449163L;

	/** The grade. */
	private char grade;
	
	/** The course id. */
	private String courseID;
	
	/** The notes. */
	private String notes;
	
	public CourseRecord(String myCourseID)
	{
		courseID = myCourseID;
		grade = ProjectConstants.NO_GRADE;
		notes = "";
	}
	
	/**
	 * Instantiates a new course record.
	 *
	 * @param myCourseID the course id
	 * @param myGrade the grade
	 * @param myNotes the notes
	 */
	public CourseRecord(String myCourseID, char myGrade, String myNotes)
	{
		grade = myGrade;
		courseID = myCourseID;
		notes = myNotes;
	}
	
	/**
	 * Copy Constructor - Creates new course record identical to one passed in
	 *
	 * @param toCopy The CourseRecord to copy
	 */
	public CourseRecord(CourseRecord toCopy)
	{
		grade = toCopy.getGrade();
		courseID = toCopy.getCourseID();
		notes = toCopy.getNotes();
	}
	
	/**
	 * Gets the grade.
	 *
	 * @return the grade
	 */
	public char getGrade() 
	{
		return grade;
	}

	/**
	 * Sets the grade.
	 *
	 * @param myGrade the new grade
	 */
	public void setGrade(char myGrade) 
	{
		this.grade = myGrade;
	}

	/**
	 * Gets the course id.
	 *
	 * @return the course id
	 */
	public String getCourseID() 
	{
		return courseID;
	}

	/**
	 * Sets the course id.
	 *
	 * @param myCourseID the new course id
	 */
	public void setCourseID(String myCourseID) 
	{
		this.courseID = myCourseID;
	}

	/**
	 * Gets the notes.
	 *
	 * @return the notes
	 */
	public String getNotes() 
	{
		return notes;
	}

	/**
	 * Sets the notes.
	 *
	 * @param myNotes the new notes
	 */
	public void setNotes(String myNotes) 
	{
		this.notes = myNotes;
	}
	
	public String toString()
	{
		String retString = "";
		
		retString += "Course ID: " + getCourseID() + "\n";
		retString += "Course Grade: " + getGrade() + "\n";
		retString += "Course Notes:" + getNotes() + "\n";
		
		return retString;
	}
	
	
	/**
	 * The main method. For unit testing.
	 *
	 * @param args the arguments
	 */
	public static void main(String[] args)
	{
		CourseRecord myCR = new CourseRecord("CMSC201", 'A', "This is a test.");
		System.out.println("Course ID: " + myCR.getCourseID());
		System.out.println("Course Grade: " + myCR.getGrade());
		System.out.println("Course Notes:\n" + myCR.getNotes());
	}
}
